<?php
/* 
    Project     : 48c6c450f1a4a0cc53d9585dc0fee742
    Created on  : Mar 16, 2013, 11:29:15 PM
    Author      : Truong Khuong - khuongxuantruong@gmail.com
    Description :
        Purpose of the stylesheet follows.
*/
class frontend extends CI_Module {

    function __construct()
    {
        parent::__construct();
        $this->load->model('customer_model');
        
    }
    function addCustomer($params){
        return $this->customer_model->_insert($params);
    }
    function checkLogin($e='',$p=''){
        $customer=$this->customer_model->getCustomerByEmail($e);
        if($customer){
            if($customer->cust_password==md5($customer->cust_email.$p.$customer->cust_salt)){
                unset($customer->cust_password,$customer->cust_salt);
                $_SESSION['frontend']['customer']=$customer;
                return true;
            }
        }
        return false;
    }
}
?>
